//引入请求函数
import request from "@/utils/request";
import { requestHttp } from "@/utils/request";


//引入类型约束
import type { reqBannerListResponse, reqHomeCategoryResponse, reqHomeHotResponse, reqGuessLikeResponse } from "@/type/home";

/** 此文件关于首页部分的请求函数 */

//首页轮播图api。"distributionSite: 1首页 | 2商品分类页 "
export function reqBannerList (distributionSite?:number) {
    return requestHttp<reqBannerListResponse[]>({
        url:"/home/banner",
        method:"get",
        params:{
            distributionSite
        }
    })
}

//首页前台分类
export const reqHomeCategory = () => {
    return requestHttp<reqHomeCategoryResponse[]>({
        url:"/home/category/mutli",
        method:"get"
    })
}

//首页热门推荐
export const reqHomeHot = () => {
    return requestHttp<reqHomeHotResponse[]>({
        url:"/home/hot/mutli",
        method:"get"
    })
}

//猜你喜欢请求api
export const reqGuessLikeList = (page?:number, pageSize?:number) => {
    return requestHttp<reqGuessLikeResponse>({
        url:"/home/goods/guessLike",
        method:"get",
        params:{
            page,
            pageSize
        }
    })
}